<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Spec::Rails::Example</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Spec::Rails::Example</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/controller_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/controller_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/functional_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/functional_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/helper_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/helper_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/ivar_proxy_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/ivar_proxy.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/model_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/model_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/rails_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/rails_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/render_observer_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/render_observer.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example/view_example_group_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/view_example_group.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/lib/spec/rails/example_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/spec/rails/example/controller_spec_spec_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/spec/rails/example/controller_spec_spec.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/spec/rails/example/helper_spec_spec_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/spec/rails/example/helper_spec_spec.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/spec/rails/example/model_spec_spec_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/spec/rails/example/model_spec_spec.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/spec/rails/example/view_spec_spec_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/spec/rails/example/view_spec_spec.rb
                </a>
        <br />
                <a href="../../../files/__\__\vendor\plugins\rspec_on_rails/spec/spec_helper_rb.html">
                ..\..\vendor\plugins\rspec_on_rails/spec/spec_helper.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
<a href="Example.html">Spec::Rails::Example</a> extends <a
href="../Example.html">Spec::Example</a> (RSpec&#8216;s core <a
href="Example.html">Example</a> module) to provide <a
href="../Rails.html">Rails</a>-specific contexts for describing <a
href="../Rails.html">Rails</a> Models, Views, Controllers and Helpers.
</p>
<h2>Model Examples</h2>
<p>
These are the equivalent of unit tests in <a
href="../Rails.html">Rails</a>&#8217; built in testing. Ironically (for the
traditional TDD&#8216;er) these are the only specs that we feel should
actually interact with the database.
</p>
<p>
See <a
href="Example/ModelExampleGroup.html">Spec::Rails::Example::ModelExampleGroup</a>
</p>
<h2>Controller Examples</h2>
<p>
These align somewhat with functional tests in rails, except that they do
not actually render views (though you can force rendering of views if you
prefer). Instead of setting expectations about what goes on a page, you set
expectations about what templates get rendered.
</p>
<p>
See <a
href="Example/ControllerExampleGroup.html">Spec::Rails::Example::ControllerExampleGroup</a>
</p>
<h2>View Examples</h2>
<p>
This is the other half of <a href="../Rails.html">Rails</a> functional
testing. View specs allow you to set up assigns and render a template. By
assigning mock model data, you can specify view behaviour with no
dependency on a database or your real models.
</p>
<p>
See <a
href="Example/ViewExampleGroup.html">Spec::Rails::Example::ViewExampleGroup</a>
</p>
<h2>Helper Examples</h2>
<p>
These let you specify directly methods that live in your helpers.
</p>
<p>
See <a
href="Example/HelperExampleGroup.html">Spec::Rails::Example::HelperExampleGroup</a>
</p>

    </div>


   </div>


  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="Example/RenderObserver.html" class="link">Spec::Rails::Example::RenderObserver</a><br />
Class <a href="Example/ControllerExampleGroup.html" class="link">Spec::Rails::Example::ControllerExampleGroup</a><br />
Class <a href="Example/FunctionalExampleGroup.html" class="link">Spec::Rails::Example::FunctionalExampleGroup</a><br />
Class <a href="Example/HelperExampleGroup.html" class="link">Spec::Rails::Example::HelperExampleGroup</a><br />
Class <a href="Example/ModelExampleGroup.html" class="link">Spec::Rails::Example::ModelExampleGroup</a><br />
Class <a href="Example/RailsExampleGroup.html" class="link">Spec::Rails::Example::RailsExampleGroup</a><br />
Class <a href="Example/ViewExampleGroup.html" class="link">Spec::Rails::Example::ViewExampleGroup</a><br />

    </div>




      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>